﻿@model List<MvcMusicStore.Models.Album>
@{
    ViewBag.Title = "ASP.NET MVC Music Store";
}

<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Samples/AjaxForm/MusicScripts.js")" type="text/javascript"></script>

<div id="promotion">
</div>

@using (Ajax.BeginForm("ArtistSearch", "AjaxForm", 
    new AjaxOptions {
     InsertionMode=InsertionMode.Replace,
     HttpMethod="GET",
     OnFailure="searchFailed",     
     LoadingElementId="ajax-loader",
     UpdateTargetId="searchresults",               
}))
{
    <input type="text" name="q" />
    <input type="submit" value="search" />
    <img id="ajax-loader" 
         src="@Url.Content("~/Content/Images/ajax-loader.gif")" 
         style="display:none"/>
}

<div id="searchresults">

</div>

<br />
<br />
<h3>
    <em>Fresh</em> off the grill</h3>
<ul id="album-list">
    @foreach (var album in Model)
    {
        <li><a href="@Url.Action("Details", "Store", new { id = album.AlbumId })">
            <img alt="@album.Title" src="@album.AlbumArtUrl" />
            <span>@album.Title</span> </a></li>
    }
</ul>

